<?
	$link = mysqli_connect("localhost:3306","Julan","123456");//数据库端口的连接
    mysqli_select_db($link, "myhometown");//连接数据库
    mysqli_query($link, "set name 'utf-8'");//查询语句设置字符集
    $str ="select * from 景点";  //查询语句
    $result = mysqli_query($link,$str);
    $arr=array();
    while($row = mysqli_fetch_array($result))
    {
        $arr[] = $row;
    }
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
table,th,td
{
	border:1px solid  #000;
}
</style>
</head>
<body>
    <table align="center">
        <th colspan="5">景点储存系统</th>
        <tr>
        <td>名称</td>
        <td>经度</td>
        <td>纬度</td>
        <td>简介</td>
        <td>详细介绍</td>
        <td>图片路径</td>
        </tr>
    
        <?php
        foreach ($arr as $key=>$value)
             {
        ?>
              <tr>
              <td><?php echo $value['attraction_name'];?></td>
              <td><?php echo $value['Longitude'];?></td>
              <td><?php echo $value['Latitude'];?></td>
              <td><?php echo $value['Introduction'];?></td>
              <td><?php echo $value['detail_introduction'];?></td>
            <td><img src="<?php echo $value['image_path'];?>" alt="景点风景" width="300" height=auto></td>
              </tr>
         
        <?php }?>
   </table>
</body>
</html>
